package com.bbz.core.groovy

import groovy.xml.MarkupBuilder

/**
 * Groovy Hello World
 */
class Example {
    static void main(String[] args) {
        println("Hello World");
        int x = 5>7?0:3;
        for (int i in 1..x) {
            println(i);
        }
        def mB = new MarkupBuilder()

        // Compose the builder
        mB.collection(shelf: 'New Arrivals') {
            movie(title: 'Enemy Behind') {
                type('War, Thriller')
                format('DVD')
                year('2003')
                rating('PG')
                stars(10)
            }
            description('Talk about a US-Japan war')
        }
        System.out.println()
        List<Integer> list = new ArrayList<>();
        list.add(1);
        list.add(2);
        boolean a = list.findResult {
           it==3?true:null
        }
        System.out.print(a)
    }
}
